home *** CD-ROM | disk | FTP | other *** search
- Path: FreeNet.Carleton.CA!ah956
- From: ah956@FreeNet.Carleton.CA (Susheel Jalali)
- Newsgroups: comp.lang.c++
- Subject: Re: Need help using g++ and Templates
- Date: 28 Mar 1996 04:42:22 GMT
- Organization: National Capital Freenet, Ottawa, Canada
- Sender: ah956@freenet.carleton.ca (Susheel Jalali)
- Message-ID: <4jd5be$7va@freenet-news.carleton.ca>
- NNTP-Posting-Host: freenet.carleton.ca
-
- I think
- Is it true that you cannot have
- #pragma implementation "abc.h"
-
- in more than one .cc file?
-
- If I do then I get multiply defined symbols.
-
- But if I instantiate those templates in more than one .cc
- file what am I supposed to do with #pragma's in those files?
- I get undefined symbols too!
-
- I do: put templates in .h files and use #pragma interface
- with those. Then make sure that each such file gets
- 'associated' with exactly one .cc file and use #pragma
- implementation with that file. The association defaults
- to the files with the same stem name, so you need to
- do explicit #pragma implementation "file.h" for cases
- without "file.cc" in, say, you main.cc module.
-
-